package com.truyen.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.truyen.persistence.dao.SearchLoaiTruyenTrinhThamDao;
import com.truyen.persistence.entity.LoaiTruyenChu;
import com.truyen.persistence.entity.SearchLoaiTruyenTrinhTham;
import com.truyen.persistence.entity.TruyenTrinhTham;
import com.truyen.service.SearchLoaiTruyenTrinhThamService;
import com.truyen.utils.PagingInfo;


@Service
public class SearchLoaiTruyenTrinhThamServiceImpl implements SearchLoaiTruyenTrinhThamService {
	
	@Autowired
	private SearchLoaiTruyenTrinhThamDao searchLoaiTruyenTrinhThamDao;

	@Override
	public void save(SearchLoaiTruyenTrinhTham entity) {
		searchLoaiTruyenTrinhThamDao.save(entity);
	}

	@Override
	public SearchLoaiTruyenTrinhTham findById(Long id) {
		return searchLoaiTruyenTrinhThamDao.findById(id);
	}

	@Override
	public List<SearchLoaiTruyenTrinhTham> getAll() {
		return searchLoaiTruyenTrinhThamDao.findAll();
	}

	@Override
	public SearchLoaiTruyenTrinhTham findByProperty(String column, Object value) {
		List<SearchLoaiTruyenTrinhTham> lst = searchLoaiTruyenTrinhThamDao.findByProperty(column, value);
		return (lst.size()>0)?lst.get(0):null;
	}

	@Override
	public List<SearchLoaiTruyenTrinhTham> getAllLst(String kwSearch, String sort, String sortBy,
			PagingInfo pInfo) {
		return searchLoaiTruyenTrinhThamDao.getAllLst(kwSearch,sort,sortBy,pInfo);
	}

	@Override
	public SearchLoaiTruyenTrinhTham findByLoaiTruyenTrinhThamVTruyenTrinhTham(
			LoaiTruyenChu loaiTruyenChu, TruyenTrinhTham truyen) {
		return searchLoaiTruyenTrinhThamDao.findByLoaiTruyenTrinhThamVTruyenTrinhTham(loaiTruyenChu,truyen);
	}

	@Override
	public List<SearchLoaiTruyenTrinhTham> getLstByLoaiTruyenTrinhThamWithPaging(
			LoaiTruyenChu loaiTruyenChu, String orderBy, PagingInfo pInfo) {
		return searchLoaiTruyenTrinhThamDao.getLstByLoaiTruyenTrinhThamWithPaging(loaiTruyenChu,orderBy,pInfo);
	}


}
